<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>forsikrings beregner</title>
</head>

<body>
<?php	
	if (isset( $_REQUEST["alder"])) {
		$alder=$_REQUEST["alder"];
		$koen=$_REQUEST["koen"];
		$pris=500;
		
		if (isset($_REQUEST["civilstand"])) {
			$civilstand="gift";
		}
		else {
			$civilstand="ugift";
		}
		
		if ($alder < "25" && $koen=="mand" && $civilstand=="ugift") {
			$pris=$pris + 1500;
		}
		if ($koen=="kvinde" || $civilstand=="gift") {
			$pris=$pris - 200;
		}
		if($alder>="46" && $alder<="64") {
			$pris=$pris - 100;
		}
		echo"prisen er: kr. $pris";
	}

?>
<table border="1">

	<tr>

	<td><form action="forsikringsberegner2.php">
    	<input type="radio" value="mand" name="koen" />Mand<br />
        <input type="radio" value="kvinde" name="koen" />Kvinde<br />
		<th>Alder:<select name="alder">
<?php
	for($a=18; $a<=100;$a++) {
		echo"<option value=$a>$a</option>";
	}
?>
        </select><br />
        <td>
    	<input type="checkbox" name="civilstand" />Gift
    	<br /><input type="submit" />
	</form>
    
    
    
    
    
    
    </body>
</html>